Schemas may be used to define types used in a computing environment. A schema typically defines the constraints on the structure and content of objects of that type, above and beyond the basic syntax of the language in which the type is defined. In many embodiments, a schema may be considered a high level of abstraction for a document or program to which the schema applies.
Types that conform to a schema are, by definition, acceptable and useable by a program that complies with the schema. Schemas may be defined in many different languages and protocols. In the case of schemas defined in XML, the process of checking to see if an XML document conforms to a schema is called validation, which is separate from XML's core concept of syntactic well-formedness. Typical XML documents are well-formed, but a document may be valid when an XML parser may check the document for conformance with the document's schema. Documents are considered valid if they conform to the schema with which they have been associated.
There are languages developed specifically to express XML schemas. The Document Type Definition (DTD) language, which is native to the XML specification, is a schema language that is of relatively limited capability, but that also has other uses in XML aside from the expression of schemas. Two other very popular, more expressive XML schema languages are XML Schema (W3C) and RELAX NG.
The mechanism for associating an XML document with a schema may vary according to the schema language. The association may be achieved via markup within the XML document itself, or via some external means.